from api.login_api import LoginApi
from common.assert_tools import assert_tools


class TestLogin:
    def setup_class(self):
        self.Login = LoginApi()

    def test01(self):
        req_data = {"mobile": "13800000002", "password": "123456"}
        resp = self.Login.login(req_data)
        print("登录成功",resp.json())
        assert_tools(resp,200,True,10000,"操作成功")


    def test02(self):
        req_data = {"mobile": "13800000003", "password": "123456"}
        resp = self.Login.login(req_data)
        print("手机号错误",resp.json())
        assert_tools(resp, 200, False, 20001, "用户名或密码错误")


    def test03(self):
        req_data = {"mobile": "13800000002", "password": "12345"}
        resp = self.Login.login(req_data)
        print("密码错误",resp.json())
        assert_tools(resp, 200, False, 20001, "用户名或密码错误")

    def test04(self):
        req_data = {"mobile": "1380000000", "password": "123456"}
        resp = self.Login.login(req_data)
        print("10位手机号",resp.json())
        assert_tools(resp, 200, False, 20001, "用户名或密码错误")
    def test05(self):
        req_data = {"mobile": "138000000020", "password": "123456"}
        resp = self.Login.login(req_data)
        print("12位手机号",resp.json())
        assert_tools(resp, 200, False, 20001, "用户名或密码错误")